package cn.edu.sdjzu.xg21.service;

import cn.edu.sdjzu.xg21.dao.SchoolDao;
import cn.edu.sdjzu.xg21.domain.School;
import cn.edu.sdjzu.xg21.exception.BysjException;

import java.sql.SQLException;
import java.util.Collection;

public class SchoolService {
    private SchoolService(){}
    private School school = null;
    private Collection<School> schools = null;
    private static SchoolService schoolService = null;
    public static SchoolService getInstance() throws SQLException {
        if(schoolService == null){
            schoolService = new SchoolService();
        }
        return schoolService;
    }
    public School find(Integer id) throws SQLException, BysjException {
       school = SchoolDao.getInstance().find(id);
       return school;
    }
}

